﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MontagsmalerApp.Utils
{
  public class Network
  {
    public static string GetNetworkConnectionString()
    {
      // Host
      string HostName = System.Net.Dns.GetHostName();
      System.Net.IPHostEntry hostInfo = System.Net.Dns.GetHostEntry(HostName);
      string IpAdresse = "unbekannt";

      for (int i = 0; i < hostInfo.AddressList.Length; i++)
      {
        if (!hostInfo.AddressList[i].IsIPv6LinkLocal)
        {
          IpAdresse = hostInfo.AddressList[i].ToString();
          break;
        }
      }

      return "http://" + HostName + ":8091/";
    }
  }
}
